package com.example.respdto;


import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class resultDTO<E> {
    private String code;
    private String msg;
    private E data;

    public resultDTO(String code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public   resultDTO(String code,String msg,E data){
        this.code=code;
        this.msg=msg;
        this.data=data;
    }

   public static resultDTO success(Object data){
        return new  resultDTO( "200","success",data);
    }
    public static resultDTO success(){
        return new  resultDTO( "200","success");
    }
    public static resultDTO fail(){
        return new resultDTO("400","fail");
    }

}
